/* 
 * AUTHOR: Kevin Lam
 */

package com.apps.ubc.cc.controller;

import java.io.IOException;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.apps.datastore.AccountInformationDatastore;
import com.apps.datastore.dao.AccountObject;
import com.apps.utils.BCryptUtils;

public class ActivationController extends HttpServlet{
	AccountInformationDatastore d = new AccountInformationDatastore();

	public void doGet(HttpServletRequest req, HttpServletResponse resp) {
		String username = req.getParameter("user").toLowerCase();
		String auth = req.getParameter("auth");
	
		boolean result = d.activateAccount(username, auth);
		
		try {
			if (result)
				resp.sendRedirect("/debug.jsp?msg=activation_sucess");
			else
				resp.sendRedirect("/debug.jsp?msg=activation_failed");
		} catch (IOException e) {
			e.printStackTrace();
		}

	}

}
